package com.xywy.common.util;

import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.xywy.R;

public class ImageLoaderUtil {
   public static void displayImage(String url, ImageView iv){
	   DisplayImageOptions  options = new DisplayImageOptions.Builder()
       .showStubImage(R.drawable.imageloader_default)              
       .showImageForEmptyUri(R.drawable.imageloader_default)     
       .showImageOnFail(R.drawable.imageloader_default)                
       .cacheInMemory(true)                                               //缓存用
       .cacheOnDisc(true)                                                    //缓存用
       .build();
	   ImageLoader.getInstance().displayImage(url, iv,options);
   }
   
   public static void displayHeadImage(String url, ImageView iv){
	   DisplayImageOptions  options = new DisplayImageOptions.Builder()
       .showStubImage(R.drawable.head_bg)              
       .showImageForEmptyUri(R.drawable.head_bg)     
       .showImageOnFail(R.drawable.head_bg)                
       .cacheInMemory(true)                                               //缓存用
       .cacheOnDisc(true)                                                    //缓存用
       .build();
	   ImageLoader.getInstance().displayImage(url, iv,options);
   }
}
